// Render a link for posting links to delicious.
// version 1.0
// 2006-07-16
// Copyright (c) 2006, Calvin Yu
//
// --------------------------------------------------------------------
//
// This is a Tails script.
//
// To install, you need Tails: http://blog.codeeg.com/tails-firefox-extension/
// Then restart Firefox and revisit this script and click on 'Install'.
//
// To uninstall, go to Tools/Manage Tails Scripts...,
// select "Add to del.icio.us", and click Uninstall.
//
// --------------------------------------------------------------------
//
// ==TailsScript==
// @name          Add to del.icio.us
// @namespace     http://blog.codeeg.com/tails-firefox-extension-03
// @description   Render a link for posting links to delicious.
// @include       xfolk
// @include       hfeed
// ==/TailsScript==

getURL: function() {
  var name = null;
  var url = null;
  if (this.object.__name == 'xfolk') {
    name = this.object.taggedlink.name;
    url = this.object.taggedlink.url;
  } else if (this.object.__name == 'hfeed' && this.object.bookmark) {
    name = this.object['entry-title'];
    url = this.object.bookmark;
  }
  if (url) {
    var r = "http://del.icio.us/post?url=" + url;
    if (name)
      r += "&title=" + name;
    return r;
  }
}
